1. Field of the Invention
The invention relates to an information processing device, an image pickup device, an image processing method and a computer program, and more particularly, to an information processing device; an image pickup device, an image processing method and a computer program, which is capable of reducing an invalid data region, which is generated in a data writing process for a non-volatile memory such as a flash memory, and maintaining data with certainty.
2. Background Art
Recently, as a data storage device of various electronic apparatuses such as personal computers (PC), data recording/reproducing devices, personal digital assistants (PDA) or video cameras, a flash memory is widely used. The flash memory, which is capable of easily writing and erasing data, has properties such as a small size, a light weight, a high speed and a lower power consumption and is used as a storage medium of image data, sound data, a text file, a program or the like.
More particularly, a memory card in which a flash memory can be attached and detached to and from an electronic apparatus is widely used. For example, a memory card for storing image data acquired by a video camera is mounted and reproduced in a PC or music data acquired through the Internet using a PC or from a storage medium such as CD, DVD or MD is stored in a memory card and the memory card is mounted and reproduced in a portable player.
As shown in FIG. 1, in a flash memory, a block 110 which is a unit for erasing data and a page 120 which is a unit for reading and writing data are defined. The flash memory has a plurality of blocks and one block includes a plurality of pages. One page includes, for example, a 512-byte data storage region 121 and a 16-byte expanded region (extra region) 122 for writing parity data. The sizes of data storage region and the expanded region vary depending on the flash memory. For example, there may be provided a combination of a 2048-byte data storage region 121 and a 64-byte expanded region (extra region) 122.
Recently, in accordance with a high speed and a large capacity, the size of a minimum unit (page) for writing data or a minimum unit (block) for erasing data in the flash memory has increased. However, the size of data which is desired to be stored in the flash memory, that is, data of one-time recording process, may be very smaller than that of the page defined in the flash memory. When the data is recorded without alteration, a large invalid data region exists in the page and, as a result, the amount of valid data written in the entire flash memory is reduced.
As a method of suppressing the generation of an invalid data region, the following two configurations have been suggested.
In a first configuration, for example, a writing process is not executed until data to be written, for the size of a page, is collected, the data is stored in a volatile memory such as a RAM in a device, and the data is written in the flash memory when the data for the size of the page defined in the flash memory is stored. By this configuration, the invalid region of the flash memory can be reduced.
In a second configuration, data is sequentially written in a flash memory, valid data in a plurality of pages are read and connected by a defragment process such that an invalid region is reduced in the pages of the flash memory in which data is written, and the data is newly written. Even by this configuration, the invalid region of the flash memory can be reduced.
However, in the first configuration, since the data is not written in the flash memory until the size of the data stored in the volatile memory such as RAM becomes the size of the page, when a power source is suddenly turned off while a photographing/recording process is executed by a video camera, that is, while a data recording process is executed in an information processing device, the data stored in the volatile memory such as RAM is lost and data for the size of the page of the flash memory may be fully lost.
In the second configuration, the data written in the flash memory is read, connected and rewritten, a chain structure between the pages is managed before the connecting and rewriting process, and the rewriting process is executed in consideration of the information on the chain structure upon the connecting and rewriting process and the layout of the data in a non-volatile memory. Thus, a process becomes complicated. In addition, for the above-described process, management data should be stored, a region for storing the management data should be ensured, and, as a result, the size of a connecting/rewriting program increases.